/*
* @Author: dengjiayao
* @Date:   2017-08-28 16:56:28
* @Last Modified by:   dengjiayao
* @Last Modified time: 2017-10-24 11:01:40
*/
import Vue from './vue'
import store from './vuex/store'
import { alert } from 'vue-strap'
import loginCheck from './util/login-check'
import AnnouncementList from './announcement/list/list.vue'
import AnnouncementConfig from './announcement/config/config.vue'

new Vue({
  el: 'body',
  components: {
    'vue-alert-msg': alert,
    'vue-list': AnnouncementList,
    'vue-config': AnnouncementConfig
  },
  store,
  created() {
    loginCheck(this)
  },
  vuex: {
    getters: {
      msg: state => state.msg
    }
  },
  methods: {
    addItem() {
      let ref = this.$refs.announcementConfig
      ref.actionType = 'ADD'
      ref.form = {
        market: '1',
        position: '0',
        content: '',
        url: '',
        type: '0',
        validBeginTime: '',
        validEndTime: ''
      }
      ref.showModal = true
    }
  }
})
